<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link type="text/css" rel="stylesheet" href="../assets/mui/css/mui.min.css"/>
    <link type="text/css" rel="stylesheet" href="../assets/sui/sui1.0.1.css"/>
    <style type="text/css">
        .content-item{
            margin-bottom:10px;
        }
        .content-title{
            background-color:#ffffff;
            background-image: url(../image/tm_bg_profile_banner_normal.png);
        }
        .user-item{
            padding:5px;
        }
        .user-name{
            width:80px;
            overflow:hidden;
            margin:0 auto;
            text-align:center;
            color:#666666;
        }
        .user-image img{
            width:80px;
            height:80px;
            border-radius:50%;
        }
        .user-image img{
            width:80px;
            height:80px;
            border-radius:5%;
        }
        .user-info{
            padding:10px 5px 0 5px;
        }
        .user-nickname{
            height:36px;
            line-height:36px;
            overflow:hidden;
            color:#666666;
        }
        .user-desc{
            height:52px;
            line-height:26px;
            overflow:hidden;
            color:#666666;
            font-size:15px;
        }
        li{
            color:#666666;
            font-size:15px;
        }
        .item-button{
            padding:0 15px;
        }
        .item-button button{
            padding:12px 0;
        }
    </style>
</head>
<body ms-controller="user-detail" class="ms-controller">
    <div class="content-item content-title">
        <div class="user-item sui-flex-row">
            <div>
                <div class="user-image"><img ms-attr-src="headimgurl"/></div>
                <div class="user-name"><span>{{username}}</span></div>
            </div>
        </div>
    </div>
    </div>
    <div class="content-item">
        <ul class="mui-table-view">
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right">
                    当前经验值: 1008
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right">
                    距离升级还有: 200
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right">
                    当前积分: 200
                </a>
            </li>
        </ul>
    </div>
    <div class="content-item">
        <ul class="mui-table-view">
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right" onclick="favorable()">
                    <span class="mui-icon mui-icon-star"></span>我的优惠卷
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right" onclick="collect()">
                   <span class="mui-icon mui-icon-home"></span> 收藏的密室店
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right" onclick="collecttheme()">
              <span class="mui-icon mui-icon-flag"></span>收藏的主题
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right" onclick="friend()">
                <span class="mui-icon mui-icon-contact"></span>我的好友
                </a>
            </li>
        </ul>
    </div>
    <div class="content-item">
        <ul class="mui-table-view">
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right" onclick="experience()">
                                                      我玩过的主题
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right" onclick="geteval()">
                                                        我的评价
                </a>
            </li>
            <li class="mui-table-view-cell">
                <a class="mui-navigate-right" onclick="indent()">
                                                        我的订单
                </a>
            </li>
        </ul>
    </div>
    <div class="content-item item-button">
        <button class="mui-btn mui-btn-block mui-btn-primary" onclick="logout()">退出当前账号</button>
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/avalon.mobile.js"></script>
<script type="text/javascript" src="../script/public.js"></script>

<script type="text/javascript">
    var userModel = avalon.define({
        $id:"user-detail",
        headimgurl:"",
        username:"",
        user:{}
    });
     function collect(){
       api.openWin({
            name: 'usercollectwin',
            url: 'user/usercollectwin.html'
        }); 
     }
     function collecttheme(){
         api.openWin({
	         name: 'userthemewin',
	         url: 'user/userthemewin.html'
         });
     }
    function logout(){
	     api.openWin({
	         name: '',
	         url: ''
         });	
    }
    function experience(){
      api.openWin({
	      name: 'experiencewin',
	      url: 'user/experiencewin.html'
      });
    }
     function friend(){
        api.openWin({
	        name: 'unfriendwin',
	        url: 'user/unfriendwin.html'
        });
     }
     function geteval(){
        api.openWin({
	        name: 'userevalwin',
	        url: 'user/userevalwin.html'
        });
     }
     function favorable(){
       api.openWin({
	       name: 'privilegewin',
	       url: 'user/privilegewin.html'
       });
     }
     function indent(){
       api.openWin({
	       name: 'userindentwin',
	       url: 'user/userindentwin.html'
       });
     }
    apiready = function(){
        if (!isLogin()){
            loginFromWX();
        }
       userModel.headimgurl = $api.getStorage('headimgurl');
       userModel.username = $api.getStorage('username');
		callSvr("user/getStatus",{code:getUserCode()},function(result){
            userModel.user = result;
        });
    }
</script>
</html>